<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="t" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<t:layout title="Sellers - Instasale">

    <h4>Note that deleting a seller will also delete all his cars.</h4>

    <table class="table table-bordered">
        <thead>
        <tr>
            <th>ID</th>
            <th>Title</th>
            <th>Actions</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="seller" items="${sellersList}">
            <tr>
                <td>${seller.id}</td>
                <td>${seller.title}</td>
                <td>
                    <form:form method="delete" action="/sellers/${seller.id}/">
                        <input type="submit" value="x" class="btn btn-small btn-danger"/>
                    </form:form>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>

    <a href="/sellers/new" class="btn btn-success">New seller</a>

</t:layout>